﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Camera;//引入Camera命名空间

namespace CameraFactory
{
    public static class Factory
    {
        ///// <summary>
        ///// 动态链接链接库的位置
        ///// </summary>
        //private static string dllPath;
        ///// <summary>
        ///// 加载的类库名称
        ///// </summary>
        //private static string classFullName;

        /// <summary>
        /// 通过反射加载动态链接库
        /// </summary>
        /// <returns></returns>
        public static AbstractCamera GetCameraObj()
        {
            ////对动态链接库的路径与类的名称进行赋值
            //string[] txtStrLines = System.IO.File.ReadAllLines("./CameraInfo.txt");
            //dllPath = txtStrLines[0];//动态链接库的位置
            //classFullName = txtStrLines[1];//类的名称
            //创建类的实例
            return (AbstractCamera)System.Reflection.Assembly.LoadFile("./CameraClassLibrary.dll").CreateInstance("CameraClassLibrary.Dahua");
        }
    }
}
